#ifndef CONSOLE_DOCK_WIN_H
#define CONSOLE_DOCK_WIN_H

////////////////////////////////////////
#include <QObject>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QWidget>
#include <QIODevice>
#include <QDockWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>
#include <QCheckBox>
#include <QTextBrowser>
#include <QScrollArea>
#include <QSplitter>
#include <QSettings>
#include <QHBoxLayout>

#define MAX_PRESET_TEXT_CNT	(50)

QByteArray HexStringToByteArray(QString hexString);

class PreSetText : public QObject
{
	Q_OBJECT

public:
	PreSetText(QString text);
	~PreSetText(void);
	QHBoxLayout *getLayou(void);

signals:
	void send(QByteArray);

private slots:
	void on_send_clicked(void);

private:
	QString m_obj_name;
	QHBoxLayout *m_hLayout;
	QCheckBox m_check;
	QLabel m_hex_text;
	QPushButton m_send_button;
	QLineEdit m_line;
};

class ConsoleDockWin : public QDockWidget
{
	Q_OBJECT

public:
	ConsoleDockWin(QWidget *parent);
	~ConsoleDockWin(void);

public slots:
	void log_data(QString);
	void log_data(QByteArray);

signals:
	void send(QByteArray data);

private slots:
	void on_recv_send_data(QByteArray data);
	void on_send_clicked(void);

private:
	QSplitter *m_main_splitter;
	QTextBrowser *m_log;
	QLabel m_hex_text;
	QCheckBox *m_hex_check;
	QLineEdit *m_send_line;
	QPushButton *m_send_button;
	QScrollArea *m_preset_text_scrollarea;
	QList<PreSetText *> m_preset_text_list;
};


#endif